<?php
class ctrl_index extends doom_core_ctrl {
	
	public function __construct($request, $response, $template) {
		parent::__construct($request, $response, $template);
	}
	
	public function action_default($request, $response, $template) {
	    $response->setContentType();
	    
	    
	    $userId = 9527;
	    
 		$userModel = doom_core_factory::getModel('user', null);
		//$userModel = doom_factory::getFactory('model')->getModel('user', null);
 		$user = $userModel->getByUserId($userId);
		
 		if ($user === FALSE) {
 		    echo '出错，应该转到错误页面。';
 		    var_dump($userModel->error);
 		    exit;
 		}

//  		doom_config::$LOG_LEVEL = doom_core_log::LEVEL_ALL;
 		
 		$logger = doom_core_factory::getLog('class.mainlog');
 		
 		$logger->debug('haha');
 		
 		$response->add('user', $user);
		$template->load('index', 'default');
	}
	
	public function action_test($request, $response, $template) {
		echo __METHOD__;
		$s = $request->getText('b');
		var_dump($s);
	}
}
